#!/bin/bash

echo -e "\033[33m更新skynet_util\033[0m"
git pull; 

#------------------------------------------初始化--------------------------------------------------#
modules=("skynet" "pbc" "lua-serialize" "lua-cjson" "lua-cjson-mysql")
if [ ! -d 3rd ]; then
    mkdir 3rd
fi
cd 3rd
for module in ${modules[*]}
do
    if [ ! -d ${module} ]; then
        echo -e "\033[33m初始化${module}\033[0m"
        git clone -b master --recursive https://gitee.com/wk1988/${module}.git 
    else
        echo -e "\033[33m更新${module}\033[0m"
        cd ${module}
        git pull; git submodule update --init --recursive
        cd ..
    fi
done
cd ..
echo -e "\033[32m初始化完毕!\033[0m"